package com.docshare.util;

public class Tool {
    public static final String MessageToken = "..:..";


    public static int bytesToInt(byte[] bytes) {
        return bytesToInt(bytes, 0);
    }

    public static int bytesToInt(byte[] b, int k) {
        int mask = 0xff;
        int temp = 0;
        int res = 0;

        for(int i = 0; i < 4; i++) {
            res <<= 8;
            temp = b[i + k] & mask;
            res |= temp;
        }

        return res;
    }
}
